﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Department/Master.Master" AutoEventWireup="true" CodeBehind="ManageRequest.aspx.cs" Inherits="logicunivesityinventorystore.ManageRequest" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript" >
    function ShowEditModal() {
       
        $find('EditModalPopup').show();
    }
    function okay() {
        $get('<%= Button1.ClientID %>').click();
    }
</script>
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <h1>Manage Request</h1>
        <b>
        <asp:Label ID="lblempID" runat="server" Visible="False"></asp:Label>
        <br />
        <asp:Button ID="Button1" runat="server" onclick="btnOK_Click" Width="1px" 
            Height="1px" BackColor="White"/>
        Requisition List:</b>     
        <asp:Button ID="Button2" runat="server" Width="1px" Height="1px" 
            BackColor="White"/>
            <br />
        <br />
        <asp:GridView ID="gvReqList" runat="server" Height="119px" Width="611px" 
            AutoGenerateColumns="False" DataSourceID="ObjectDataSource2" 
            onrowcommand="gvReqList_RowCommand" 
            onrowdatabound="gvReqList_RowDataBound">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelection" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="RequisitionFormID">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnFormId" runat="server" 
                            CommandArgument='<%# Eval("RequisitionID") %>' 
                            Text='<%# Bind("RequisitionID") %>' CommandName="Select"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Date" HeaderText="Date" />
                <asp:BoundField DataField="EmployeeName" HeaderText="Employee Name" />
                <asp:BoundField DataField="Remark" HeaderText="Remark" />
                <asp:TemplateField HeaderText="Action">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnReject" runat="server" 
                            CommandArgument='<%# Eval("RequisitionID") %>' CommandName="Remove">Reject</asp:LinkButton>
                       
                        <%--<asp:ConfirmButtonExtender ID="lbtnReject_ConfirmButtonExtender" runat="server" 
                            ConfirmText="Are you sure you want to reject?" Enabled="True" TargetControlID="lbtnReject">
                        </asp:ConfirmButtonExtender>--%>
                       
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            SelectMethod="GetRequisitionDetails" 
            TypeName="BusinessLogicLayer.RequisitionFacade">
            <SelectParameters>
                <asp:ControlParameter ControlID="lblempID" DefaultValue="" Name="empid" 
                    PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <br />
        <asp:Button ID="btnApprove" runat="server" Text="Approve" 
            onclick="btnApprove_Click1" CssClass="ButtonStyle" Height="26px" 
            Width="80px" />
            <%--<asp:ConfirmButtonExtender ID="btnApprove_ConfirmButtonExtender" 
            runat="server" ConfirmText="Are You Sure you want to approve?" Enabled="True" TargetControlID="btnApprove">
        </asp:ConfirmButtonExtender>--%>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnApproveAll" runat="server" Text="Approve All" 
            onclick="btnApproveAll_Click" CssClass="ButtonStyle" />
            <br />
        <br />
        <asp:Label ID="lblOrderDetail" runat="server" Text="Label"><b>OrderDetails:</b></asp:Label>
        <br />
        <br />
       
                <asp:GridView ID="gvOrderDetails" runat="server" Height="51px" 
            Width="246px">
                </asp:GridView>
                 <asp:ModalPopupExtender ID="lbtnReject_ModalPopupExtender" runat="server" 
                            PopupControlID="Panel1"  OkControlID="btnOk" Enabled="True" TargetControlID="Button2" OnOkScript="okay();" BehaviorID="EditModalPopup" >
                        </asp:ModalPopupExtender>
       <div id="Panel1" style="display: none;" class="modalPopup">
        <asp:TextBox ID="txtHeadRemarks" runat="server" TextMode="MultiLine"></asp:TextBox>
        <asp:Button ID="btnOk" runat="server" Text="OK" OnClientClick="okay()" />
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
    </div>
        </ContentTemplate>
        <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                </Triggers>
    </asp:UpdatePanel>
   
            </asp:Content>

<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder3">

                </asp:Content>
<asp:Content ID="Content4" runat="server" 
    contentplaceholderid="ContentPlaceHolder4">

                </asp:Content>


